package com.app.micaihu.view.login.contract

import com.app.base.mvp.BaseView
import com.app.http.bean.BaseBean
import com.app.micaihu.bean.infor.UserInfor
import com.app.micaihu.view.bean.AccountConflict

/**
 *
 */
interface LogInContract {
    interface View : BaseView {
        fun handleLogin(login: BaseBean<UserInfor?>?) {}
        fun handleBoundThirdUser(result: BaseBean<UserInfor?>?) {}
        fun handleFlashLogin(login: BaseBean<UserInfor?>?) {}
        fun handleCaptchaLogin(login: BaseBean<UserInfor?>?) {}
        fun handleSendCode(result: BaseBean<Any?>?) {}
        fun handleCheckMobile(result: BaseBean<Any?>?) {}
        fun handleChangePassword(result: BaseBean<Any?>?) {}
        fun handleSetMainUser(result: BaseBean<UserInfor?>?) {}
        fun handleBoundMobile(result: BaseBean<AccountConflict?>?) {}
        fun handleFlashBoundMobile(result: BaseBean<AccountConflict?>?) {}
    }

    interface Presenter {
        /**
         * 第三方登录
         */
        fun quickLogin(openId: String?, nickName: String?, headPic: String?, fromType: String)
        /**
         *
         * 绑定第三方账户
         * @param  string fromType 登录类型：(1微信登录，2qq登录, 3手机号，4微博)
         * @param  string openid 第三方用户openId
         * @param  string nickname 第三方昵称
         * @param  string avatar 第三方头像
         * @param  string thirdInfo 描述信息
         * @param  string military 军种 1陆军，2海军，3空军，4火箭军，5战略支援，6武警
         * @param  string masterUid 主账户ID
         */
        fun boundThirdUser(openId: String?, nickName: String?, headPic: String?, fromType: String)

        /**
         * 账号登录
         */
        fun login(mobile: String, password: String)

        /**
         *  闪验 一键登录
         */
        fun flashLogin(token: String)

        /**
         *  验证码 登录
         */
        fun captchaLogin(mobile: String, captcha: String)

        /**
         * 登录
         */
        fun weiLogin(userId: String)

        /**
         * 获取验证码
         * @type 0、注册1、忘记密码2、绑定手机3、修改手机4、修改密码
         */
        fun sendCode(mobile: String, type: String)

        /**
         * 检验手机号
         * @type 0、注册1、忘记密码2、绑定手机3、修改手机4、修改密码
         */
        fun checkMobile(mobile: String)

        /**
         * 更改密码-1,找回密码-2
         */
        fun changePassword(mobile: String, captcha: String, password: String, type: String)

        /**
         * 绑定手机   params.put("uid", UserInforManager.getInstance().getUserInfor().getUid());
        params.put("captcha", code);
        params.put("password", pwd);
        params.put("mobile", mPhoneNum);
         */
        fun boundMobile(mobile: String, captcha: String, password: String)

        /**
         * 闪验一键绑定用户手机
         */
        fun flashBoundMobile(token: String)

        /**
         * 设置主账户
         */
        fun setMainUser(masterUid: String, slaveUid: String)
    }
}